<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>$title</title>
    <base href="$baseurl" />
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="static/bootstrap3.3.0/css/bootstrap.min.css">
    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="static/bootstrap3.3.0/css/bootstrap-theme.min.css">
    <script src="static/js/jquery-1.12.4.min.js"></script>
    <script src="static/js/sea.js" type="text/javascript"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="static/bootstrap3.3.0/js/bootstrap.min.js"></script>

    <script src="static/jquery-jsonview-master/dist/jquery.jsonview.min.js"></script>
    <link href="static/jquery-jsonview-master/dist/jquery.jsonview.min.css" rel="stylesheet" >
   <script type="text/javascript">

      jQuery(function($) {
        $(".websockettype").each(function (index, domEle) {
         var wscode = $(this).find('.websockettypecode textarea').val();
          wscodeobj = JSON.parse(wscode);
         $(this).find('.websockettypecodedisplay .showcode').JSONView(wscodeobj);
        });
      });



	function fastview(url,_this,width){
		
		seajs.use(['/static/artDialog/src/dialog'], function (dialog) {
			var d = dialog({
			    content: 'loading..',
			    width: width,
				height: 80,
				padding: 10,
				quickClose: true,
			    onshow: function () {
			    	var _dthis = this;
			    	$.getJSON(url+'&inajax=1', function(content){
			    		_dthis.content(content);
			    		_dthis.height($('.varscontent').height());
			    		console.log($('.varscontent').height());
						_dthis.reset();  
			    	});
			    }
			}).show(_this);
		});


/*		
			seajs.use(['/static/artDialog/src/dialog'], function (dialog) {
				choicedialog = dialog({ 
					content: content,
					width: 600,
					height: 80
				}).show(_this);
			});

		});*/
	}


      function displayws(_this){
          $(_this).parents('.websockettype').find('.websockettypecodedisplay').toggle();
      }



      </script>
      <style type="text/css">
      	.tablefont{
      		font-family: Georgia,Verdana;
      	}
		.tabletitle {
		   font-weight: 700
		}
      </style>
   
  </head>
  <body>




  <div class="container-fluid">
  <p>
  	<!--{eval $i=1}-->
  	  <div class="list-group">
  	  	<li  class="list-group-item list-group-item-success"><b>$i. 接口</b></li>
		<li  class="list-group-item"><b>$APINAME</b></li>
      <!--{loop $data $key $one}-->
      <!--{eval $i++}-->
        <li  class="list-group-item list-group-item-success"><b>$i. $Tags[$key]</b></li>
		<!--{if $key == 'name'}-->
		<li  class="list-group-item ">$one[title] $one[description]</li>


			<!--{eval $i++}-->
			<li  class="list-group-item list-group-item-success"><b>$i. 开发工具</b></li>
			<li  class="list-group-item">
			  <div class="btn-group btn-group-sm">
			  	<a type="button" class="btn btn-default" href="wiki/log?display={$APINAME}"  target="_blank">1. 日志记录查看工具</a>
				<a type="button" class="btn btn-default"  href="wiki/tool?display={$APINAME}" target="_blank">2. 签名&模拟调试工具</a>
			  </div>
			 </li>


		<!--{elseif $key == 'param'}-->
		<li  class="list-group-item">
			<table class="table table-bordered table-striped table-info list-group-item-info tablefont">
				<tbody>
					<tr><td  colspan="4" valign="middle">● 接口参数</td></tr>
					<tr><td width="20%">参数</td><td width="10%">类型及范围</td><td width="33px">必选</td><td width="531px">说明</td></tr>
					<!--{if  $one}-->
						<!--{loop $one $k $v}-->
						<tr><td style="font-weight:bold;">$v[varname]</td><td>$v[type]</td><td>$v[must]</td><td>$v[description]</td></tr>
						<!--{/loop}-->
					<!--{else}-->
						<tr><td  colspan="4" valign="middle" align="center" style="    font-style: oblique;" >无参数</td></tr>
					<!--{/if}-->
				</tbody>
			</table>
			<table class="table table-bordered table-striped table-info list-group-item-info tablefont">
				<tbody>
					<tr><td  colspan="4" valign="middle" >● 全局参数</td></tr>
					<!--{loop $dataparam $k $v}-->
					<tr><td width="20%" style="font-weight:bold;">$v[varname]</td><td width="10%">$v[type]</td><td width="33px">$v[must]</td><td width="531px">$v[description]</td></tr>
					<!--{/loop}-->
				</tbody>
			</table>

		</li>
		<!--{elseif $key == 'var'}-->
		<li  class="list-group-item">
			<table class="table table-bordered table-striped table-info list-group-item-info">
				<tbody>
					<tr><td  colspan="3" valign="middle" >● 字段列表</td></tr>
					<tr><td width="20%">参数</td><td width="10%">类型及范围</td><td width="531px">说明</td></tr>

					<!--{if  $one}-->
						<!--{loop $one $k $v}-->
						<tr>
							<td style="font-weight:bold;">
								<!--{if $v[varname] == 'status'}-->
									$v[varname]
								<!--{elseif isset($vars[$v[varname]])}--><a href="javascript:;" onclick="fastview('wiki/vars?display=$v[varname]',this,1000)" target="_blank">$v[varname]	</a> <a href="wiki/vars?display=$v[varname]" target="_blank"><img src="static/image/linktarget.png"></a>
								<!--{else}-->
									$v[varname]
								<!--{/if}-->
							</td>
							<td>$v[type]</td><td>$v[description]  <!--{if $v[varname] == 'status'}-->
								<a href="javascript:;" onclick="fastview('wiki/error?display=$APINAME',this,1000)" target="_blank">当前接口返回错误码</a> <a href="wiki/error?display=$APINAME" target="_blank"><img src="static/image/linktarget.png"></a>
								<!--{/if}-->
							</td>
						</tr>
						<!--{/loop}-->
					<!--{else}-->
						<tr><td  colspan="3" valign="middle" align="center" style="    font-style: oblique;" >无参数</td></tr>
					<!--{/if}-->

				</tbody>
			</table>
		</li>
		<!--{elseif $key == 'example'}-->
		<li  class="list-group-item">
		<!--{loop $one $k $v}-->
				<div class="formatstatus">
				
				<!--{if $v[status]}-->
				<span class="status _{$v[status]}">$v[status]</span>
				<!--{/if}-->
				<!--{if $v[format]}-->
				<span class="format">[ $v[format] ]</span>
				<!--{/if}-->
			</div>
			<div class="content">
				<pre>
				<!--{if $v[format]}-->
					<code class="$v[format]">$v[content]</code>
				<!--{else}-->
					$v[content]
				<!--{/if}-->
				</pre>
			</div>
		<!--{/loop}-->
		</li>
		<!--{else}-->
		<li  class="list-group-item">$one</li>
		<!--{/if}-->
      <!--{/loop}-->
      </div>
    </p>
  </div>



  </body>
</html>
